﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace Test1
{
    public partial class Form15_01 : Form
    {
        public Form15_01()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;
        }
        int x=12;
        void Roll()
        {
            while (x <= 260)
            {
                pictureBox1.Location = new Point(x, 12);
                Thread.Sleep(500);
                x += 4;
                if (x >= 260)
                {
                    x = 12;
                }
            }
        }
        private void Form15_01_Load(object sender, EventArgs e)
        {
            Thread th = new Thread(new ThreadStart(Roll));
            th.Start();
        }
    }
}
